@inherits BaseEditPlugin
@namespace FluentCMS.Web.Plugins.IFrame

<PluginModalForm Open="Open" Title="Edit IFrame" Model="@Model" OnSubmit="HandleSubmit" OnCancel="OnCancel" Name="IFrameEditPlugin">
    <FormSwitch Label="Use Source URL" Text="Select to use a page URL, or deselect to embed custom HTML for the iframe." @bind-Value="@Model!.IsUsingSrc" />

    @if (Model.IsUsingSrc)
    {
        <FormInput Label="Source URL" Placeholder="Enter the URL of the external page to display" Hint="Provide the URL of the webpage you wish to embed in the iframe." @bind-Value="@Model!.Src" />
    }
    else
    {
        <FormTextarea Label="Embed Code" Rows="5" Placeholder="Enter custom HTML for the iframe" Hint="Paste the full HTML embed code here. This will override the Source URL if provided." @bind-Value="@Model!.EmbedCode" />
    }

    <FormInput Label="Height" Placeholder="Enter the iframe height (e.g., 400px, 50%)" Hint="Specify the height of the iframe. You can use pixels (px), percentage (%), or other valid CSS units." @bind-Value="@Model!.Height" />
</PluginModalForm>
